#pragma once
#include "CAnimatedObject.h"


class CUnit : public CAnimatedObject
{
private:
protected:
	int m_nMaxHitpoints;
	int m_nCurHitPoints;
	int m_nPower, m_nDefense, m_nSpeed, m_nVitality;

public:
	//accessors
	int GetMaxHP(){ return m_nMaxHitpoints; }
	int GetCurHP(){ return m_nCurHitPoints; }
	int GetPower(){ return m_nPower; }
	int GetDefense(){ return m_nDefense; }
	int GetSpeed(){ return m_nSpeed; }
	int GetVitality(){ return m_nVitality; }

	//mutators
	 void SetMaxHP(int maxHP){ m_nMaxHitpoints = maxHP; }
	 void SetCurHP(int curHP){ m_nCurHitPoints = curHP; }
	 void SetPower(int pwr){ m_nPower = pwr; }
	 void SetDefense(int def){ m_nDefense = def; }
	 void SetSpeed(int spd){ m_nSpeed = spd; }
	 void SetVitality(int vit){ m_nVitality = vit; }


	//Function for receiving damage, (negative numbers ignored), returns true if the Unit is still alive, false if their HP went to/below 0
	bool TakeDamage(int dmg);
};